package top.zywork.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.zywork.dao.GoodsPromotionDAO;
import top.zywork.dos.GoodsPromotionDO;
import top.zywork.dto.GoodsPromotionDTO;
import top.zywork.service.AbstractBaseService;
import top.zywork.service.GoodsPromotionService;

import javax.annotation.PostConstruct;

/**
 * GoodsPromotionServiceImpl服务接口实现类<br/>
 *
 * 创建于2019-07-26<br/>
 *
 * @author http://zywork.top 王振宇
 * @version 1.0
 */
@Service(value = "goodsPromotionService")
public class GoodsPromotionServiceImpl extends AbstractBaseService implements GoodsPromotionService {

    private GoodsPromotionDAO goodsPromotionDAO;

    @Autowired
    public void setGoodsPromotionDAO(GoodsPromotionDAO goodsPromotionDAO) {
        super.setBaseDAO(goodsPromotionDAO);
        this.goodsPromotionDAO = goodsPromotionDAO;
    }

    @PostConstruct
    public void init() {
        super.init(GoodsPromotionDO.class, GoodsPromotionDTO.class);
    }

    @Override
    public int updateActiveByOtherId(Long shopId, Long goodsId, Long goodsSkuId, byte isActive) {
        return goodsPromotionDAO.updateActiveByOtherId(shopId, goodsId, goodsSkuId, isActive);
    }
}
